﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewsList.aspx.cs" Inherits="Maticsoft.Web.wap.NewsList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <!--#include file="include/head.htm"-->
    <script type="text/javascript">
        $(function () {
            $("#hidPage").val('1');
            LoadList();
        })

        function LoadList() {
            $.ajax({
                type: "get",
                url: "NewsList.aspx",
                data: "sync=true&page=" + $("#hidPage").val() + "&d=" + new Date().toString(),
                success: function (msg) {
                    if (msg != "") {
                        var obj = eval('(' + msg + ')');
                        var res = "";
                        for (var i = 0; i < obj.list.length; i++) {
                            res += "<div class=\"mui-input-row\">";
                            res += "<label class=\"tc-black\" style=\"width:90%\"><a href=\"NewsDetail.aspx?id=" + obj.list[i].id + "\">" + obj.list[i].title.substring(0,17) + "</a></label>";
                            res += "<a class=\"gotonext mui-text-right mui-pull-right\" href=\"javascript:;\"></a>";
                            res += "</div>";
                        }

                        $(".mui-content").prepend(res);

                        if (parseInt(obj.total) > parseInt(obj.currPage)) {
                            $("#hidPage").val(parseInt(obj.currPage) + 1);
                            $("#listMore").show();
                        }
                        else {
                            $("#listMore").hide();
                        }
                    }
                },
                error: function (msg) {

                }
            })
        }

        function LoadMore() {
            LoadList();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="hidPage" runat="server" />
    <header class="mui-bar">
			<a class="mui-action-back gotoup mui-pull-left"></a>
			<h1 class="mui-title">通知公告</h1>
			<a class="mui-pull-right tc-black"></a>
		</header>
    <div class="mui-content pad-btm-60">
        <div id="listMore" style="width: 100%; text-align: center; line-height: 50px; background-color: #f6f4f4;
            cursor: pointer;" onclick="LoadMore();">
            加载更多</div>
    </div>
    </form>
</body>
</html>
